package com.cskaoyan.controller;
import com.cskaoyan.bean.StatInfo.GoodsVo;
import com.cskaoyan.bean.StatInfo.StatVo;
import com.cskaoyan.bean.StatInfo.UserVo;
import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.service.StatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 
 * 创建日期: 2022/05/06 11:37
 * @author wangyonghong
 */
@RestController
@RequestMapping("admin/stat")
public class StatController {
    @Autowired
        StatService statService;
    @GetMapping(value = "user")
    public BaseRespVo getUser() {
        UserVo userVo= statService.queryUser();
        return  BaseRespVo.ok(userVo);
    }

    @GetMapping(value = "order")
    public BaseRespVo getOrder() {
        StatVo orderVo= statService.queryOrder();
        return  BaseRespVo.ok(orderVo);
    }

    @GetMapping(value = "goods")
    public BaseRespVo getGoods() {
        GoodsVo goodsVo= statService.queryGoods();
        return  BaseRespVo.ok(goodsVo);
    }
}
